package com.my.java.design_mode.producerconsumer;

/**
 * 生产者线程，负责生产公共资源
 */
public class ProducerThread implements Runnable {
	private PublicResource resource;

	public ProducerThread(PublicResource resource) {
		this.resource = resource;
	}

	public void run() {
		for (int i = 0; i < 20; i++) {
			resource.increace();
		}
	}
}
